home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 4 / The Arsenal Files 4 (Arsenal Computer).ISO / net_info / fsc-0081.l01 / FSC-0081.01A < prev    next >
Text File  |  1995-03-01  |  34KB  |  812 lines

  1.  
  2.   | Document: FSC-0081 Part A
  3.   | Version:  001
  4.   | Date:     01 Mar 1995
  5.   |
  6.   | Mikael Stσldal, 2:201/337
  7.  
  8.                          A TYPE-3 Packet proposal
  9.                     Mikael Stσldal, 2:201/337@FidoNet
  10.  
  11.  
  12. Status of this document
  13. =======================
  14. Copyright (C) 1992-1994 by Mikael Stσldal.
  15.  
  16. This document may be freely distributed and copied. The standard described
  17. may be implemented by anybody. You may not distribute modified versions of
  18. this document without written permission from the author.
  19.  
  20. Fido and FidoNet are registered trademarks of Tom Jennings and Fido
  21. Software.
  22.  
  23.  
  24. Introduction
  25. ============
  26. This is a proposal on a new packet format for use in FidoNet and other FTNs
  27. (FTN = FidoNet Technology Network). This format can be used for both NetMail
  28. (private point-to-point mail) and EchoMail (electronic conferences).
  29.  
  30. This document defines the transport layer. It also includes a presentation
  31. layer definition, but that can be changed without affecting the transport
  32. layer. It also includes a application layer (stored messages) definition,
  33. but it's not mandatory.
  34.  
  35. This packet format conforms with FSC-39, rev 4. It has the PktType field in
  36. the header at the same position as TYPE-2 and it contains a capability word
  37. at the same position as TYPE-2+ (but no CW validation copy). The packet
  38. header has also the same size as in TYPE-2. This should make it easy to
  39. implement mail-processors supporting both TYPE-2 and TYPE-3.
  40.  
  41. This packet format separates the header from the message data and the header
  42. is extensible. A mail processor (the transport layer) doesn't have to look
  43. at the message data.
  44.  
  45. This format eliminates most kludges currently used in TYPE-2.
  46.  
  47. This packet format allows multiple AreaTags in EchoMail.
  48.  
  49. This packet format is much more extensible than TYPE-2 and is probably
  50. easier to implement.
  51.  
  52. This packet format allows up to 4 GigaBytes large messages and allows binary
  53. data in messages, this makes it possible to implement multimedia
  54. capabilities in the future.
  55.  
  56.  
  57. Definitions
  58. ===========
  59.  
  60. Characters
  61. ----------
  62. In this document, literal characters are written as two uppercase hexadecimal
  63. (base 16, 0..9A..F) digits following by lowercase h, e.g. "1Fh". The
  64. following abbreviations are used: "NUL" means 00h, "CR" means 0Dh and
  65. "space" means 20h (the quotation marks are not included).
  66.  
  67.  
  68. Basic data types
  69. ----------------
  70. Name      Length  Description
  71. ----------------------------------------------------------------------------
  72. ShortInt    1     8-bit unsigned integer.
  73. Integer     2     16-bit unsigned integer, Intel 8086 byte order.
  74. LongInt     4     32-bit unsigned integer, Intel 8086 byte order.
  75. Byte        1     Field of 8 bits.
  76. Word        2     Field of 16 bits, Intel 8086 byte order.
  77. String[n]   n     Fixed length string of n bytes, NUL-padded.
  78. String{n} max n   Variable length string of max n bytes, NUL-terminated.
  79.                   n includes the terminating NUL.
  80. String            Variable length string, not terminated.
  81.  
  82.  
  83. Address
  84. -------
  85. Field      Type            Description                             Range
  86. ----------------------------------------------------------------------------
  87. Zone       Integer         Zone address.                          1..65535
  88. Net        Integer         Net address.                           1..65535
  89. Node       Integer         Node address.                          0..65535
  90. Point      Integer         Point address or zero if boss.         0..65535
  91.  
  92.  
  93. FTN address in text format
  94. --------------------------
  95. An FTN address in text format must, unless otherwise stated, be in the
  96. Zone:Net/Node[.Point] format, where .Point must be excluded if point is
  97. zero, included otherwise.
  98.  
  99.  
  100. TimeStamp
  101. ---------
  102. A LongInt which contains the number of seconds since 00:00:00 1st January
  103. 1970 UTC.
  104.  
  105.  
  106. Organization
  107. ------------
  108. An organization is a network such as FidoNet, VirNet, SigNet or InterNet.
  109. It's sometimes called "domain", but I use the term organization to avoid
  110. confusion with InterNet domains.
  111.  
  112.  
  113. Reserved
  114. --------
  115. All fields marked "reserved for future extension" must be zeroed when
  116. creating/writing and ignored when reading. They might be defined by future
  117. revisions of this document.
  118.  
  119.  
  120. Filenames
  121. =========
  122. It's recommended to use the naming scheme in FTS-LIST, for both NetMail and
  123. EchoMail. There should be no problem with using the same name space for
  124. TYPE-2 and TYPE-3 packets because the packet headers are enough compatible.
  125.  
  126.  
  127. Packet format
  128. =============
  129. Packet header
  130. Zero or any number of data records.
  131. 00h 00h
  132.  
  133. The first two bytes of a data record is used to check for the end of a
  134. packet. If both are zero, the end is reached (and the rest, if any, should
  135. be ignored).
  136.  
  137.  
  138. Packet header
  139. =============
  140. Field      Type            Description
  141. ----------------------------------------------------------------------------
  142. PktOrig    Address         The node who created this packet.
  143. PktDest    Address         The node who should receive this packet.
  144. SubType    Integer         Packet contents (see below).
  145. PktType    Integer         Always 3.
  146. PktDate    TimeStamp       When the packet was created.
  147. ProdCode   Integer         FTSC Product Code. 
  148.                            Programs without Product Code must use 65535.
  149. MajorVer   ShortInt        Major product version.
  150. MinorVer   ShortInt        Minor product version.
  151. Org        String[16]      Organization (see below).
  152. CapWord    Word            Capability Word (see FSC-39).
  153. Password   String[8]       Packet password.
  154. ExtraInfo  String[4]       Reserved for future extension.
  155.  
  156.  
  157. SubType
  158. -------
  159. Defines what the packet contains.
  160.  
  161. If this field is zero, data record is defined by the "Packed message" part
  162. of this document. If this field is non-zero, data record is not defined by
  163. this document.
  164.  
  165. This field can be used for two things. The first is to define new packet
  166. types without having to use a new packet header. The second is to allow
  167. distribution of other things than Email.
  168.  
  169.  
  170. Organization
  171. ------------
  172. This field contains the name of the organization the packet travels in. This
  173. field applies to both PktOrig and PktDest since packets are
  174. intra-organization.
  175.  
  176.  
  177. Packed message
  178. ==============
  179. The messages should be in chronological order in a packet.
  180.  
  181. Field      Type              Description
  182. ----------------------------------------------------------------------------
  183. HeadSize   Integer           Size of the message header (see below).
  184. MsgFlags   Word              Message flags (see below).
  185. MsgDate    TimeStamp         When the message was created.
  186. MsgID      LongInt           Unique message identifier (see below).
  187. ReplyID    LongInt           Reply linkage information (see below).
  188. MsgLength  LongInt           Size of MsgData.
  189. MsgOrig    Address           The node who created this message.
  190. MsgDest    Address           The node who should receive this message.
  191. CharSet    ShortInt          Character set (see below).
  192. MsgType    ShortInt          Type of MsgData (see below).
  193. Area       String{255}       AreaTag(s) (see below).
  194. OrigAddr   String{255}       Origin address in text format (see below).
  195. ReplyAddr  String{255}       Reply linkage information (see below).
  196. FromUser   String{255}       Who wrote this message?
  197. ToUser     String{255}       To whom?
  198. Subject    String{255}       Subject or one filename
  199.                              (for file attaches and requests).
  200. Path       String{65535}     Path (see below).
  201. HeadExt    String            Header extension fields (see below).
  202. MsgData    String            Message data (see below).
  203.  
  204.  
  205. HeadSize
  206. --------
  207. The total size of the message header (all fields except MsgData). Since this
  208. is an Integer, the header can't be bigger than 65535 bytes and Path can never
  209. reach it's maximum length (how big it can be depends on how big the rest of
  210. the header is).
  211.  
  212.  
  213. Message flags
  214. -------------
  215. Bit  Flag          Meaning
  216. ----------------------------------------------------------------------------
  217.  0   Pvt           Private message.
  218.  1   File          File attach message.
  219.  2   FileReq       File request message.
  220.  3   UpdReq        File update request message.
  221.  4   Direct        Do not route this message.
  222.  5   Crash         High priority mail.
  223.  6   Hold          Hold for pickup.
  224.  7   IMM           Immediate mail (highest priority).
  225.  8   RRQ           Return receipt request (see below).
  226.  9   CRQ           Confirm receipt request (see below).
  227. 10   IRR           Is return receipt (see below).
  228. 11   Machine       Message to a program (see below).
  229. 12   NoForCC       CC in NetMail, NoForward in EchoMail (see below).
  230. 13   Permanent     Message must not be purged by age (see below).
  231. 14   Foreign       Message is from another organization.
  232. 15   reserved      Reserved for future extension.
  233.  
  234.  
  235. RRQ, CRQ and IRR
  236. ----------------
  237. The RRQ and CRQ flags without IRR is used to ask the software at the final
  238. destination to generate a receipt message to the sender. The receipt to an
  239. RRQ flagged message must be generated when the message is received, and
  240. this receipt must have the IRR and RRQ flags set. The receipt to a CRQ
  241. flagged message must be generated when it has been read by its addressee,
  242. and this receipt must have the IRR and CRQ flags set.
  243.  
  244. A receipt must have the ReplyAddr and ReplyID fields set as if it was a
  245. reply to the original message.
  246.  
  247. It's up to each network's policy to decide if all systems must support this,
  248. no system are allowed to support this or all systems are allowed but not
  249. forced to support this.
  250.  
  251.  
  252. Machine
  253. -------
  254. The Machine flag indicates that this message is addressed to a program and
  255. not a human. A mail processor should store such messages as defined in the
  256. "Stored message" section later in this document so the program doesn't have
  257. to support 4711 different message base formats. The name of the program must
  258. be in the ToUser field.
  259.  
  260.  
  261. Carbon Copy
  262. -----------
  263. The CC flag is used for sending a NetMail message to several nodes. Which
  264. nodes is determined by the MsgDest field.
  265.  
  266. If the message is addressed to a Zone Coordinator, the message is destined
  267. for all nodes in that zone. If the message is addressed to a Region
  268. Coordinator, the message is destined for all nodes in that region. If the
  269. message is addressed to a Net Coordinator, the message is destined for all
  270. nodes in that net. If the message is addressed to a HUB, the message is
  271. destined for all nodes under that HUB.
  272.  
  273. If the receiver of a CC message have other coordinators (or HUBs) below, it
  274. must send the message to them as CC's too.
  275.  
  276. If the ToUser field is empty the message is considered to be addressed to
  277. the SysOp and the name is taken from the nodelist (or set to "SysOp"). This
  278. must be done by the system immediate before the destination (usually the
  279. destination's HUB).
  280.  
  281.  
  282. Permanent
  283. ---------
  284. This flag indicates that the message must not be removed when old messages
  285. is cleaned out.
  286.  
  287. A new message with this flag automatically erase an old message with the
  288. same data in the Subject field. If you want to erase a permanent message
  289. without replacing it with a new, then post an empty message with the
  290. Permanent flag and the appropriate data in the Subject field.
  291.  
  292. This flag can only be used in EchoMail.
  293.  
  294.  
  295. OrigAddr
  296. --------
  297. This field must contain the true origin address of the message in text
  298. format followed by an "@" (40h) and the name of the originating
  299. organization.
  300.  
  301.  
  302. Message ID
  303. ----------
  304. The origin address and MsgID fields are used as a unique message identifier.
  305. How the MsgID field is generated is left to the implementor, but it must be
  306. unique for each message generated on a given node in at least three years.
  307. MsgID must normally not be zero, zero is used to indicate lack of
  308. Message-ID.  With this system these two fields together is unique for every
  309. message, and can be used for duplicate detection and other things.
  310.  
  311.  
  312. Reply linkage information
  313. -------------------------
  314. In a reply the ReplyAddr and ReplyID fields must be identical to the origin
  315. address, and MsgID fields in the replied message. A message which is not a
  316. reply must have these fields empty. Use the ReplyAddr field to check this.
  317.  
  318.  
  319. Area
  320. ----
  321. A list of one or more AreaTags in EchoMail, just a NUL in NetMail. If the
  322. list contains more than one tag, they are separated by space. 00h through
  323. 1Fh are not allowed in this field (except NUL as the terminator).
  324.  
  325.  
  326. Path
  327. ----
  328. This field contains a series of addresses separated by space. The first
  329. system must place its address in this field and every system that routes the
  330. message must add its address to this field,
  331.  
  332. Note that the first address in this field and the address in the MsgOrig
  333. field doesn't have to be the same.
  334.  
  335. The first address must be the origin address in this format:
  336. zone:net/node.point@organization
  337.  
  338. In the other addresses organization, zone, net and node must be omitted if
  339. same as the previous address.
  340.  
  341. The other addresses must be in one of these formats:
  342. zone:net/node.point@organization
  343. zone:net/node.point
  344. net/node.point
  345. node.point
  346. .point
  347.  
  348. .point must be excluded if point is zero, except when .0 stands alone.
  349.  
  350. Example:
  351. 1:123/324@FidoNet sends a routed NetMail message to 2:224/546.5; 1:123/300,
  352. 1:123/0, 1:12/0, 1:1/2, 2:22/888, 2:22/0, 2:224/0, 2:224/546 and 2:224/546.3
  353. routes the message (in that order). The path field must in this case be
  354. "1:123/324@FidoNet 300 0 12/0 1/2 2:22/888 0 224/0 546 .3" when
  355. 2:224/546.5 receives the message. Note that the message is routed via a
  356. point, that might not be so common but it's technically possible.
  357.  
  358. In EchoMail, the Path field can also contain addresses suffixed by an
  359. exclamation mark ("!", 21h). This means that that node hasn't routed the
  360. message, but the message has been sent to him. Similar to SEEN-BY's in
  361. FTS-4. However, this should only be used when necessary.
  362.  
  363. Never send an EchoMail message to a node listed in the Path field; regardless
  364. if the address is suffixed by an exclamation mark or not.
  365.  
  366. If the message originates in a non-FTN organization, the name of the origin
  367. organization prefixed by an "@" (40h) must be placed before the address of
  368. the gateway. In such cases there may also be some other FTN addresses before
  369. the non-FTN organization name if the message have travelled from an FTN, via
  370. a non-FTN and to a FTN again.
  371.  
  372. Example:
  373. someone@one.two.three in InterNet sends a routed NetMail message to
  374. 1:222/345 in FidoNet via the gateway 1:222/111 and 1:222/300. The path field
  375. must in this case be "@InterNet 1:222/111@FidoNet 300" when 2:222/345
  376. receives the message.
  377.  
  378. If there's not enough room to update the Path field (add what you should and
  379. have at least two bytes left), put a single "$" (24h) in it instead (and a
  380. space between it and the last address).
  381.  
  382. This field has the same format as the PTH line specified in FSC-44 (except
  383. the "$"). Read FSC-44 for more information.
  384.  
  385.  
  386. HeadExt
  387. -------
  388. This field contains zero or more NUL-terminated strings. The end of this
  389. field can be determined by the HeadSize field, but there must be a NUL after
  390. the last string anyway. If there are no strings here, there must not be any
  391. NUL either.
  392.  
  393. Each string here is a header extension field. A header extension field
  394. contains a keyword followed by a space and some data. A header extension
  395. field can contain only a keyword with no data, in such case a space must not
  396. be used either.
  397.  
  398.  
  399. Inter-organization messages
  400. ---------------------------
  401. To send a message to an other organization place the final address in text
  402. format followed by an "@" (40h) and the name of the destination organization
  403. in a header extension field with the keyword "DEST" and address the message
  404. to a gateway.
  405.  
  406. If the message must travel over more than one organization-border, the
  407. addresses to each gateway can be pointed out by header extension fields with
  408. the keyword "ROUTE". ROUTE fields contains addresses in the same format as
  409. DEST lines. The order of the ROUTE fields is important and the DEST field
  410. must be after the ROUTE field(s). When the gateway pointed by a ROUTE field
  411. processes the message it must change "ROUTE" to "ROUTD".
  412.  
  413. Note: The gateway from your organization are pointed out by the MsgDest
  414. field so there must not be a ROUTE field for that gateway.
  415.  
  416. Example:
  417. You are 34:65/12@StrangeNet and want to send a message to
  418. someone@one.two.three in InterNet. StrangeNet hasn't got any gateway to
  419. InterNet, but FidoNet has gateways to both StrangeNet and InterNet. In that
  420. case the message may have the following header extension fields:
  421. ROUTE 1:1/20@FidoNet
  422. DEST someone@one.two.three@InterNet
  423.  
  424. Messages from other organizations (NetMail or EchoMail doesn't matter) must
  425. have their origin addresses (including @organization as mentioned before)
  426. stored in the OrigAddr field and the Foreign flag set.  The MsgOrig field in
  427. the header must contain the address of a bidirectional gateway.
  428.  
  429. The MsgID field must be generated using the message-ID in the originating
  430. organization, if that is possible.  If the originating network doesn't have
  431. any message-ID that can be used to create the MsgID field, the MsgID field
  432. must be set to zero. If two identical messages (with identical message-ID)
  433. enters an FTN organization at two different gateways, they should get the
  434. same MsgID. The same counts for ReplyID. ReplyAddr must also be transferred
  435. if present in the original message.
  436.  
  437. If the other organization uses a message-ID format that can't be
  438. transparently mapped to MsgID, a ORIGID header extension field is created
  439. with a direct copy of the original message-ID (both address and serial
  440. number). The same is done with reply-linkage information in a ORIGREF header
  441. extension field. This information is used if the message should be gated
  442. back to the original network.
  443. Example with message from InterNet:
  444. ORIGID <abcd43kxz@somewhere.org>
  445. ORIGREF <bcdef43gkrt@elsewhere.org>
  446.  
  447.  
  448. Message routing
  449. ---------------
  450. The transport layer (including intermediate systems (systems handling
  451. in-transit messages)) are not allowed to change anything in the MsgDate,
  452. MsgID, ReplyID, MsgLength, CharSet, MsgType, OrigAddr, ReplyAddr, FromUser,
  453. ToUser, Subject and MsgData fields. No flags may be changed by the transport
  454. layer except the Foreign flag at gateways. The only exception is if the
  455. message have to be converted to another packet type.
  456.  
  457. An intermediate system must update the Path field, both in NetMail and
  458. EchoMail.
  459.  
  460. In EchoMail, the Area field may be changed.
  461.  
  462. An intermediate system are allowed to add or change header extension fields.
  463.  
  464. An intermediate system can add a header extension field with the keyword
  465. "Via". The Via field contains information about the system and when it
  466. processed the message. It's up to each network's policy to decide if this is
  467. allowed in NetMail, EchoMail or both.
  468.  
  469. If the header is changed, the HeadSize field must be updated.
  470.  
  471.  
  472. EchoMail
  473. --------
  474. This section lists the changes to FTS-4 needed to implement EchoMail with
  475. this packet format.
  476.  
  477. SEEN-BY lines are not to be used. The Path field is used instead of PATH
  478. lines. The Area field is used instead of the AREA line. The MsgOrig and
  479. OrigAddr fields must contain the origin addresses of the message. A
  480. unaddressed EchoMail message must have the ToUser field empty, unless there
  481. is a good reason to put something there.
  482.  
  483. The MsgDest field must be used as in NetMail. If you receive a EchoMail
  484. message not addressed to any of you addresses, you must handle it as
  485. in-transit NetMail. This makes it possible to route EchoMail through nodes
  486. not connected to the area. This can be performed inter-organization as well.
  487.  
  488. Since the lack of complete SEEN-BY's, an EchoMail processor must use the
  489. single-pass technique. That means that it must export a message to all its
  490. downlinks at the same time as it tosses the message, before it goes into the
  491. local message base (it doesn't even have to get there if the area is
  492. pass-through). With this technique the tosser can do what ever it wants with
  493. the message before it stores it in the local message base since the message
  494. will never get out of it again (except when a rescan function is invoked,
  495. but the requesting system will have to stand that).
  496.  
  497. A system which receives an EchoMail message with the NoForward flag set must
  498. not export that message. This flag is indented for EchoMail processors with
  499. a rescan function, all rescanned messages must have the NoForward flag set.
  500.  
  501. The tear and origin lines have no technical meaning (the origin address is
  502. stored elsewhere) so no program is forced to create them. Additionally, a
  503. program must not require them.
  504.  
  505. To distinguish EchoMail from NetMail, check the Area field. NetMail messages
  506. have empty Area fields.
  507.  
  508. Cross-posting a message in several areas is preformed by storing multiple
  509. AreaTags in the Area field. If some of your downlinks don't have all the
  510. areas listed in the Area field then you must remove the AreaTags for the
  511. areas they don't have. All copies must still have the same MsgID. If you
  512. receive several messages with the same MsgID but different Area then you
  513. must join them into a single message and put all different AreaTags in the
  514. Area field (but not the same twice). Compare all fields in the header up to
  515. and including Subject (except Area) and not only MsgID.
  516.  
  517. When preforming dupchecking with MsgID, compare all fields in the header up
  518. to and including Subject and not only MsgID.
  519.  
  520.  
  521. CharSet
  522. -------
  523.  
  524. Value    Character set
  525. ----------------------------------------------------------------------------
  526. 1..99    ISO 8859 (8 bit)
  527. 100      ISO 10646 16 bit (Unicode)
  528. 101..149 Reserved for other 16 bit character sets
  529. 150      ISO 10646 32 bit
  530. 151      PC8-437 (The Original)
  531. 152      PC8-850 (Multilingual)
  532. 153      PC8-852 (Slavic)
  533. 154      PC8-860 (Portuguese)
  534. 155      PC8-863 (Canadian-French)
  535. 156      PC8-865 (Nordic)
  536. 157..199 Reserved for other 8 bit character sets
  537. 200..255 reserved
  538.  
  539. PC8 means IBM's codepage (8 bit).
  540.  
  541. CharSet=1 means ISO 8859-1 (Latin-1), CharSet=2 means ISO 8859-2 and so on.
  542.  
  543. CharSet concerns FromUser, ToUser and Subject. It may also concern MsgData.
  544.  
  545. Combined characters are built by 02h followed by a modifier and the base
  546. character. If you can't display the combined character, just ignore the
  547. modifier and display the base character unmodified. A combined character
  548. contains three bytes and are counted as three bytes. See FSC-51 for more
  549. information on this. There are a few things in FSC-51 that doesn't apply to
  550. this format: this method is allowed on all 8 bit character sets, not only
  551. Latin-1, and the byte values 80h through 9Fh are allowed. This can only be
  552. used for 8 bit character sets. Combined character can be used in FromUser,
  553. ToUser and Subject, it may also be allowed in MsgData.
  554.  
  555.  
  556. MsgLength, MsgType and MsgData
  557. ------------------------------
  558. If the MsgData field contains nothing (MsgLength is zero), it's an empty
  559. message. An empty message must be forwarded and routed as any other message.
  560. An empty message must not be stored in the local message base (but read
  561. about the Permanent flag).
  562.  
  563. If MsgType is zero, MsgData is defined by the "Message text" part of
  564. this document.
  565.  
  566. If MsgType is non-zero, the MsgData field is not defined by this document.
  567.  
  568.  
  569. Message text
  570. ============
  571. This part defines the presentation layer.
  572.  
  573. The CharSet field in the header concerns the message text except binary
  574. extension fields. Combined characters can be used in the message text except
  575. in binary extension fields.
  576.  
  577. If a 16 or 32 bit character set is used all characters are two or four bytes
  578. so all control codes must be prefixed by 00h or 00h 00h 00h. The bytes alone
  579. can be in printable character. The length of binary extension fields is
  580. still counted in bytes.
  581.  
  582. All 256 byte values (including NUL) are accepted in the message text. 00h
  583. through 1Fh are control codes and must not be used to represent printable
  584. characters.
  585.  
  586. A paragraph (also called "physical line") is ended with CR.
  587.  
  588. 8Dh (sometimes called "Soft CR") must not be used as a line separator since
  589. it represents a printable character in some character sets.
  590.  
  591. 01h first at a physical line (i.e. the first character of the message text
  592. or the character immediately after a CR) means that this line is a extension
  593. line. See below for more information.
  594.  
  595. 00h first at a physical line (except in another binary extension field)
  596. indicates the start of an long binary extension field. 00h is followed by a
  597. LongInt and up to almost 4 GigaBytes of binary data. A binary extension field
  598. is not terminated in any way, it's length is stored in the LongInt (the 00h
  599. and the LongInt itself is not included in the length).
  600.  
  601. 15h first at a physical line (except in another binary extension field)
  602. indicates the start of an short binary extension field. 15h is followed by a
  603. ShortInt and up to 255 bytes of binary data. A binary extension field is not
  604. terminated in any way, it's length is stored in the ShortInt (the 15h and
  605. the Integer itself is not included in the length).
  606.  
  607. Attributes:
  608. 03h = Turn off all attributes
  609. 04h = Bold
  610. 05h = Italic
  611. 06h = Underline
  612. 17h = All caps (lower case letters as small caps)
  613. 19h = Subscript
  614. 1Ah = Superscript
  615. 1Ch = Blinking
  616. 1Dh = Inverted
  617. 1Eh = Concealed
  618. Subscript automatically turns off superscript and vice versa. All other
  619. attributes can be used together. If an attribute already is on, it's turned
  620. off by the same code again. If your system doesn't support an attribute,
  621. just ignore it. CR turns off all attributes.
  622.  
  623. To quote a message begin a physical line with 1Fh followed by the initials
  624. of the person you are quoting and another 1Fh. Use just two 1Fh if you don't
  625. want any initials. Successive quoting is marked with more 1Fh:s immediate
  626. after the two first ones. A quote is ended with CR. It's up to each
  627. implementor to decide how to display quoted text, but it must be possible to
  628. distinguish it from normal text. It's recommended to display it in another
  629. color if possible. You must translate the quote to the same character set
  630. used in the rest of the message.
  631.  
  632. The last paragraph of the message text must be terminated by a CR (i.e. the
  633. last character of the message text must be a CR unless a binary extension
  634. field is last).
  635.  
  636.  
  637. Extension lines
  638. ---------------
  639. An extension line contains a keyword followed by a space and some data. A
  640. extension line can contain only a keyword with no data, in such case a space
  641. must not be used either. An extension line is ended like a paragraph.
  642.  
  643. Extension lines may not contain 00h through 1Fh. If you want binary data,
  644. use a binary extension field instead.
  645.  
  646. Extension lines are control information any should not be displayed to the
  647. user. If you want "hidden lines", then use the Concealed attribute rather
  648. than an extension line.
  649.  
  650. Information that is relevant for the transport layer must be placed in a
  651. header extension field rather than in an extension line.
  652.  
  653. Extension lines can be useful for describing a binary extension field.
  654.  
  655.  
  656. Currently defined extension lines
  657. ---------------------------------
  658. A extension line with the keyword FILE is used for sending files embedded in
  659. the message text. The keyword is followed by a eight digit uppercase
  660. hexadecimal number containing a TimeStamp for the file, a space and the
  661. filename. The filename can contain all chars valid for extension lines
  662. (including space) and must be at least 1 char and at most 255 chars. The
  663. file is stored in a binary extension field immediate after the FILE line.
  664. Examples:
  665. FILE AB34F657 FILE.EXT
  666. FILE 1234ABCD This is a filename
  667.  
  668.  
  669. Stored message
  670. ==============
  671. This is a description of the application layer, the local message base.
  672.  
  673. It is recommended to use this format to store NetMail messages locally. It
  674. can also be used for EchoMail, but that's not necessary.
  675.  
  676. Each message is stored as a single file which must have a hexadecimal number
  677. from 00000001 to FFFFFFFF as the base name and the extension MS3 (to
  678. distinguish from TYPE-2 stored messages).
  679.  
  680. Messages can be stored in two ways. Either the same way as TYPE-2 with one
  681. directory for each area (including NetMail), in that case the Area field
  682. must be empty in all messages. Or all messages in the same directory with
  683. the area field used to indicate what/which area the message belongs to (or
  684. empty to indicate NetMail). The second format is useful if you normally store
  685. EchoMail in an other format and only use this format for messages with the
  686. Machine flag.
  687.  
  688.  
  689. Field      Type              Description
  690. ----------------------------------------------------------------------------
  691. SRdate     TimeStamp         When the message was sent or received
  692.                              (see below).
  693. ReplyTo    LongInt           Message which this replies (see below).
  694. Reply1st   LongInt           First reply to this message (see below).
  695. ReplyNext  LongInt           Next reply to this message (see below).
  696. LocalFlags Word              Local flags (see below).
  697. Cost       Integer           Cost of sending in the lowest currency unit.
  698. HeadSize   Integer           Size of the message header (see below).
  699. MsgFlags   Word              Same as packed message.
  700. MsgDate    TimeStamp         Same as packed message.
  701. MsgID      LongInt           Same as packed message.
  702. ReplyID    LongInt           Same as packed message.
  703. MsgLength  LongInt           Same as packed message.
  704. MsgOrig    Address           Same as packed message.
  705. MsgDest    Address           Same as packed message.
  706. CharSet    ShortInt          Same as packed message.
  707. MsgType    ShortInt          Same as packed message.
  708. Area       String{255}       AreaTag(s) (see above).
  709. OrigAddr   String{255}       Same as packed message.
  710. ReplyAddr  String{255}       Same as packed message.
  711. FromUser   String{255}       Same as packed message.
  712. ToUser     String{255}       Same as packed message.
  713. Subject    String{255}       Same as packed message.
  714. Path       String{65535}     Path (see below).
  715. HeadExt    String            Same as packed message.
  716. MsgData    String            Same as packed message.
  717.  
  718.  
  719. HeadSize
  720. --------
  721. The total size of the message header (all fields except MsgData). Since this
  722. is an Integer, the header can't be bigger than 65535 bytes and Path can
  723. never reach it's maximum length (how big it can be depends on how big the
  724. rest of the header is).
  725.  
  726. Please note that this won't contain the same value when the same message is
  727. placed in a packet because SRdate, LocalFlags, ReplyTo, Areply and Cost
  728. isn't included then and Area might not have the same length.
  729.  
  730.  
  731. Local flags
  732. -----------
  733. Bit  Flag          Meaning
  734. ----------------------------------------------------------------------------
  735. 0    Local         Message is created locally.
  736. 1    InTransit     Message is not destined for this system.
  737. 2    Orphan        Unknown destination.
  738. 3    KillSent      Remove message after it has been sent.
  739. 4    DelSent       Delete attached file(s) after they have been sent.
  740. 5    TruncSent     Truncate attached file(s) after they have been sent.
  741. 6    Sent          Message has been sent.
  742. 7    Read          Message has been read by the SysOp.
  743. 8    Rcvd          Message has been read by its addressee.
  744. 9    Lock          Lock the message for further access.
  745. 10   DontSend      Do not send the actual message but send attached files,
  746.                    make file requests and poll the destination if necessary.
  747. 11   unused        Reserved for future extension.
  748. 12   unused        Reserved for future extension.
  749. 13   unused        Reserved for future extension.
  750. 14   unused        Reserved for future extension.
  751. 15   unused        Reserved for future extension.
  752.  
  753. Note that "sent" also can mean "picked up".
  754.  
  755.  
  756. SRdate
  757. ------
  758. The meaning of this field is determined by the Local and Sent flags.
  759. Local but not Sent: Meaningless, must be zero.
  760. Local and Sent: When the message was sent or picked up.
  761. Not Local: When the message arrived to this system.
  762.  
  763.  
  764. Reply linking
  765. -------------
  766. The ReplyTo field points at the message which the current message replies.
  767. The Reply1st field points at the first reply to the current message (the
  768. reply with lowest number); a messages with no replies must have this field
  769. set to zero. The ReplyNext field points at the next reply the same message
  770. as the current message; this field must be zero if there are no more replies
  771. to the message the current message. A message which is no reply must have
  772. the ReplyTo and ReplyNext fields set to zero.
  773.  
  774. With this system there is possible to keep track of an unlimited number of
  775. replies to any message.
  776.  
  777.  
  778. Path
  779. ----
  780. If the local flag is set, this field must be empty. It's the mail processors
  781. responsibility to insert the address here when placing the message in a
  782. packet.
  783.  
  784. When the mail processor tosses an incoming message, it must copy the Path
  785. field from the packet.
  786.  
  787.  
  788. Control file
  789. ------------
  790. In each message directory (both EchoMail and NetMail) there must be a file
  791. named LASTREAD. When an area is renumbered, this file must be updated.
  792.  
  793. Field      Type            Description
  794. ----------------------------------------------------------------------------
  795. LastRead   LongInt         The last message read.
  796. HighRead   LongInt         The highest message read.
  797. HighWater  LongInt         High-water mark (only used with EchoMail).
  798.                            This field is used by the EchoMail processor to
  799.                            store the number of the last scanned message.
  800.  
  801.  
  802. Notes
  803. =====
  804. If you are implementing this and something confuses you, ask someone who
  805. knows. Please don't guess how it should be.
  806.  
  807.  
  808. Credits
  809. =======
  810. Thanks to Krister Hansson-Renuad, Johan Olofsson, Nils Hammar, Jonas
  811. H÷gstr÷m, Mats Gefvert and others who have helped me developing this.
  812.